#include "stuff.h"

void box(Vector size, Vector position)
{
	glPushMatrix();

	glTranslatef(position.x, position.y, position.z);
	
	glBegin(GL_QUADS);
		glColor3f(0.75f, 0.0f, 1.0f);
		glVertex3f(0, size.y, 0);
		glVertex3f(size.x, size.y, 0);
		glVertex3f(size.x, 0, 0);
		glVertex3f(0, 0, 0);

		glColor3f(1.0f, 0.5f, 0.0f);
		glVertex3f(size.x, size.y, 0);
		glVertex3f(size.x, size.y, size.z);
		glVertex3f(size.x, 0, size.z);
		glVertex3f(size.x, 0, 0);

		glColor3f(0.0f, 1.0f, 1.0f);
		glVertex3f(0, size.y, size.z);
		glVertex3f(size.x, size.y, size.z);
		glVertex3f(size.x, 0, size.z);
		glVertex3f(0, 0, size.z);
		
		glColor3f(1.0f, 0.25f, 1.0f);
		glVertex3f(0, size.y, size.z);
		glVertex3f(0, size.y, 0);		
		glVertex3f(0, 0, 0);
		glVertex3f(0, 0, size.z);

		glColor3f(1.0f, 0.25f, 0.25f);
		glVertex3f(0, 0, size.z);
		glVertex3f(size.x, 0, size.z);
		glVertex3f(size.x, 0, 0);
		glVertex3f(0, 0, 0);

		glColor3f(0.25f, 0.25f, 0.25f);
		glVertex3f(0, size.y, size.z);
		glVertex3f(size.x, size.y, size.z);
		glVertex3f(size.x, size.y, 0);
		glVertex3f(0, size.y, 0);
	glEnd();

	glPopMatrix();
}

void box(GLfloat l, GLfloat w, GLfloat h, GLfloat x, GLfloat y, GLfloat z)
{
	Vector s(l, w, h);
	Vector p(x, y, z);

	box(s, p);
}

